<?php
//王晓梦
declare (strict_types=1);

namespace app\backend\validate;

use think\Validate;

class QuotationValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => 'require',
        'cate_id' => 'require',
        'qushi' => 'require',
        'name' => 'require',
        'address' => 'require',
        'price' => 'require',
        'up_down' => 'require',
        'image' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require' => 'id不能为空',
        'cate_id.require' => '请输入所属分类',
        'qushi.require' => '请输入价格趋势',
        'name.require' => '请输入产品品种',
        'address.require' => '请输入所在产地',
        'price.require' => '请输入产品价格',
        'up_down.require' => '请输入产品升降',
        'image.require' => '请上传趋势图',

    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'save' => ['cate_id', 'qushi','name', 'address','price','up_down','image'],
        'update' => ['id','cate_id', 'qushi','name', 'address','price','up_down','image']
    ];
}
